<template>
  <div>
    <van-nav-bar left-text="基本信息"></van-nav-bar>

    <van-list>
      <van-cell is-link id="van-cell">
        <span>头像</span>
        <van-image src="https://img01.yzcdn.cn/vant/cat.jpeg" />
      </van-cell>
      <van-cell is-link>
        <span>手机号</span>
        <span>16666666666</span>
      </van-cell>
      <van-cell is-link to="/code">
        <span>会员码</span>
        <van-image
          src="https://b.yzcdn.cn/public_files/4acd8532942475ffd5926d79c8bc8e2e.png"
        />
      </van-cell>
      <van-field label="姓名" placeholder="请填写您的姓名" is-link> </van-field>
      <!-- 性别选择 -->
      <van-field
        readonly
        clickable
        label="性别"
        :value="value"
        placeholder="选择性别"
        @click="showPicker = true"
        is-link
      />
      <van-popup v-model="showPicker" round position="bottom">
        <van-picker
          show-toolbar
          :columns="columns"
          @cancel="showPicker = false"
          @confirm="onConfirm"
        />
      </van-popup>
      <!-- 生日选择 -->
      <van-field label="生日" placeholder="请选择生日" is-link />
      <!-- 地区选择 -->
      <van-field is-link label="地区" placeholder="请选择所在地区" />
      <van-cell is-link>
        <span>收货地址</span>
        <span></span>
      </van-cell>
    </van-list>

    <van-nav-bar left-text="通用设置"></van-nav-bar>
    <van-cell
      id="van-cell1"
      title="个性化推荐"
      value="以允许"
      label="开启后可看到你感兴趣的内容"
      is-link
    />
  </div>
</template>

<script>
export default {
  data() {
    return {
      value: "",
      showPicker: false,
      columns: ["男", "女"],
    };
  },
  methods: {
    onConfirm(value) {
      this.value = value;
      this.showPicker = false;
    },
  },
};
</script>

<style lang="scss">
// 导航条样式
.van-nav-bar__content {
  background-color: #f8f8f8;
  height: 2.5rem;
  .van-nav-bar__text {
    color: #999999;
    font-size: 0.875rem;
  }
}
// 头像样式
#van-cell {
  width: 100%;
  height: 3.5625rem;
  padding: 0.625rem 1rem;
  display: flex;
  align-items: center;
  border: 0;
  span {
    display: inline-block;
    width: 5.425rem;
    margin-right: 0.75rem;
    font-size: 0.875rem;
    color: #646566;
  }
  .van-image {
    width: 1.875rem;
    height: 1.875rem;
    border-radius: 50%;
    overflow: hidden;
    vertical-align: middle;
    .van-image__img {
      width: 100%;
    }
  }
}
// 手机号及会员码样式
.van-cell {
  width: 100%;
  height: 2.75rem;
  padding: 0.625rem 1rem;
  display: flex;
  align-items: center;
  border-bottom: 1px solid #f5f6f7;
  span {
    display: inline-block;
    width: 5.425rem;
    margin-right: 0.75rem;
    font-size: 0.875rem;
    color: #646566;
  }
  .van-image {
    width: 1.5rem;
    height: 1.5rem;
    vertical-align: middle;
    .van-image__img {
      width: 100%;
    }
  }
}
</style>